$(function () {
    // var layer = layui.layer;
    $('#content').on("keyup", function (e) { 
        $('#wushi')[0].innerHTML = $('#wushi').length + $(this).val().length -1
    })
    $('#post').on("click", function (e) {
        e.preventDefault()
        if ($('#content').val().length == 0) {
            return  alert("请输入内容")
        } else {
            $.ajax({
                method:'POST',
                url: "/api/comment/post",
                data: {
                    content: $('#form_liuyan').serialize(),
                    typeId: 1,
                    valueId:314
                },
                success: function () {
                location.href='../../topicDetail.html'
                console.log("发布成功");
                }
            })
        }

       
    })
})